/*******************************************************************************************
 *  BulletMLParser.h
 *
 *  parseBulletMLFile : returns a pointer on a BulletML typed structure.
 *						That structure contains the parsed BulletML file ...
 *						... passed as an argument.
 *
 * freeBulletML : frees a BulletML object structure and all the objects ...
 *                ... it is made of.
 *
 *******************************************************************************************/







/*******************************************************************************************
 *  INCLUDES :
 *******************************************************************************************/
#include "BulletMLConsts.h"
#include "BulletMLTypes.h"
#include "Action.h"
#include "Fire.h"
#include "Bullet.h"







/***************************************************/
/* The different type a BulletML object can have : */
/***************************************************/
#ifndef _BML_TYPE_ENUM_
#define _BML_TYPE_ENUM_
typedef enum {vertical_bml, horizontal_bml} BMLType;
#endif



/***************************************************/
/* The BULLETML object structure :                 */
/***************************************************/
#ifndef _BML_STRUCT_
#define _BML_STRUCT_
typedef struct {

	ObjType	otype;									/* The object's type. */

	BMLType	type;									/* The BulletML type. */

	int		actionsNum;								/* How many actions?  */
	Action	*actions[MAX_BML_ACTIONS];				/* All the actions.   */

	int		firesNum;								/* How many fires ?   */
	Fire	*fires[MAX_BML_FIRES];

	int		bulletsNum;								/* How many bullets ? */
	Bullet	*bullets[MAX_BML_BULLETS];

} BulletML;
#endif







/*******************************************************************************************
 *  Function PROTOTYPES :
 *******************************************************************************************/

/* CONSTRUCTOR and DESTRUCTOR : */
BulletML 	*newBulletML(void);						/* Creates an empty BulletML object. */
void 		freeBulletML(BulletML *bml);			/* Destroying a BulletML structure.  */

/* FILLING the BulletML object structure : */
void		setBulletMLType(BulletML *bml, BMLType t);
void		addBulletMLAction(BulletML *bml, Action *a);
void		addBulletMLFire(BulletML *bml, Fire *f);
void		addBulletMLBullet(BulletML *bml, Bullet *b);

/* Parsing a BulletML file into a BulletML structure : */
BulletML	*parseBulletMLFile(const char *file_name);
